<template>
	<div class="navb">
		<ul>
			<li>
				<router-link :to="{name:'donghua',params:{tid:curTid}}">
					推荐
				</router-link>
			</li>
			<li v-for="(item,index) in secondNavList" :key=index >
				<router-link :to="{name:'donghua',params:{tid:item.tid}}">
					{{item.typename}}
				</router-link>
			</li>
		</ul>
	</div>
</template>

<script>
	let partitionList=window.__INITIAL_STATE__.reduxAsyncConnect.partitionList
	export default{
		created(){

		},
		props:{
			tid:{
				type:[Number,String],
				default:"1"
			}
		},
		data(){
			return{
				nav_list:[],
				curTid:"1"
			}
			
		},
		computed:{
			secondNavList:{
				get(){
					this.curTid=this.$store.getters.getCurTid
					this.nav_list=partitionList[this.curTid]  
					return this.nav_list
				},
				set(newValue){

				}
			}
		},
		watch:{
			tid(newValue,oldValue){
				if(this.$route.name=='donghua'){
					
					this.secondNavList=partitionList[this.$store.getters.getCurTid]
				}
				
			}
		}
	}
</script>

<style lang="scss">
	.dh{
		padding-top: 85px;
		width: 100%;
		.navb{
			background: #f9f9f9;
			>ul{
				overflow: scroll;
				padding: 0  22px;
				white-space: nowrap;
				height: 40px;
				&::-webkit-scrollbar {
				    display: none;
				}
				li{
					margin-right: 45px;
					height: 40px;
					display: inline-block;
					line-height: 40px;
					a{
						font-weight: bold;
						width: 15px;
					    font-size: 14px;
					    line-height: 40px;
					    text-align: center;
					    color: #aaa;
					    padding-bottom: 5px;
					    }
					.router-link-active{
							color: #fb7299;
					}
				}
				
				
			}
		}
		
	}
</style>